# coding=utf-8
"""
作者：董新强 
创建时间：
描述：
"""
from frameworks.redis_helper import ReidsHelper
from tornado.ioloop import IOLoop
from tornado.gen import coroutine

if __name__ == '__main__':
    @coroutine
    def tor_run():
        cache = ReidsHelper()
        try:
            result = yield cache.set('my_key', '123')
            print('set.result=>', result)

            result = yield cache.get('my_key')
            print('get . result=>', result)

            result = yield cache.get('other_key')
            print('get . result=>', result)

            result = yield cache.set('my_key', '123')
            print('set.result=>', result)

            result = yield cache.delete(['my_key'])
            print('set.result=>', result)



        finally:
            cache.close()


    IOLoop.current().run_sync(tor_run)
